(function(KKBus){

    function AdminController() {
        var self = this;
        self.user;
        self.worker = ko.observableArray();
        
        self.getWorker = function (page)
        {
            //self.historylog.removeAll();
            
            app.request++;
        
             var url = 'rest/users/WORKER';
                                 
           
        
        
        KKBus.Ajax.doGet(url, function(data, textStatus, jqXHR)
        {
      
        var jsData = JSON.parse(data);
        var i = jsData.length;
        
        
            while(i--){
                 self.worker.push(new KKBus.UserModel(jsData[i].id,jsData[i].name,jsData[i].surname )); 
         }
         app.request--;
                  
          if (app.request == 0) {
                    if (app.settings.DEBUG == true) { console.log("Load template from: " +  AdminController.name); }
                    setTimeout(function() { app.loadTemplate(); }, 1000);
                }
            });
        };
        
       
        
    }
    
    
    
   

    KKBus. AdminController =  AdminController;
    
}(window.KKBus));

